<?php


/*
* Copyright (c) 2008-2016 vip.com, All Rights Reserved.
*
* Powered by com.vip.osp.osp-idlc-2.5.11.
*
*/

namespace com\vip\wms\gb\gateway\client\service;

class InventoryInfo {
	
	static $_TSPEC;
	public $transactionId = null;
	public $actionTime = null;
	public $sn = null;
	public $type = null;
	public $warehouseName = null;
	public $recAddress = null;
	public $transferNo = null;
	public $orderNo = null;
	public $orderTime = null;
	public $serialNo = null;
	public $imei1 = null;
	public $imei2 = null;
	public $province = null;
	public $city = null;
	public $subsidyFlag = null;
	
	public function __construct($vals=null){
		
		if (!isset(self::$_TSPEC)){
			
			self::$_TSPEC = array(
			2 => array(
			'var' => 'transactionId'
			),
			3 => array(
			'var' => 'actionTime'
			),
			4 => array(
			'var' => 'sn'
			),
			5 => array(
			'var' => 'type'
			),
			6 => array(
			'var' => 'warehouseName'
			),
			7 => array(
			'var' => 'recAddress'
			),
			8 => array(
			'var' => 'transferNo'
			),
			9 => array(
			'var' => 'orderNo'
			),
			10 => array(
			'var' => 'orderTime'
			),
			11 => array(
			'var' => 'serialNo'
			),
			12 => array(
			'var' => 'imei1'
			),
			13 => array(
			'var' => 'imei2'
			),
			14 => array(
			'var' => 'province'
			),
			15 => array(
			'var' => 'city'
			),
			16 => array(
			'var' => 'subsidyFlag'
			),
			
			);
			
		}
		
		if (is_array($vals)){
			
			
			if (isset($vals['transactionId'])){
				
				$this->transactionId = $vals['transactionId'];
			}
			
			
			if (isset($vals['actionTime'])){
				
				$this->actionTime = $vals['actionTime'];
			}
			
			
			if (isset($vals['sn'])){
				
				$this->sn = $vals['sn'];
			}
			
			
			if (isset($vals['type'])){
				
				$this->type = $vals['type'];
			}
			
			
			if (isset($vals['warehouseName'])){
				
				$this->warehouseName = $vals['warehouseName'];
			}
			
			
			if (isset($vals['recAddress'])){
				
				$this->recAddress = $vals['recAddress'];
			}
			
			
			if (isset($vals['transferNo'])){
				
				$this->transferNo = $vals['transferNo'];
			}
			
			
			if (isset($vals['orderNo'])){
				
				$this->orderNo = $vals['orderNo'];
			}
			
			
			if (isset($vals['orderTime'])){
				
				$this->orderTime = $vals['orderTime'];
			}
			
			
			if (isset($vals['serialNo'])){
				
				$this->serialNo = $vals['serialNo'];
			}
			
			
			if (isset($vals['imei1'])){
				
				$this->imei1 = $vals['imei1'];
			}
			
			
			if (isset($vals['imei2'])){
				
				$this->imei2 = $vals['imei2'];
			}
			
			
			if (isset($vals['province'])){
				
				$this->province = $vals['province'];
			}
			
			
			if (isset($vals['city'])){
				
				$this->city = $vals['city'];
			}
			
			
			if (isset($vals['subsidyFlag'])){
				
				$this->subsidyFlag = $vals['subsidyFlag'];
			}
			
			
		}
		
	}
	
	
	public function getName(){
		
		return 'InventoryInfo';
	}
	
	public function read($input){
		
		$input->readStructBegin();
		while(true){
			
			$schemeField = $input->readFieldBegin();
			if ($schemeField == null) break;
			$needSkip = true;
			
			
			if ("transactionId" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->transactionId);
				
			}
			
			
			
			
			if ("actionTime" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->actionTime);
				
			}
			
			
			
			
			if ("sn" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->sn);
				
			}
			
			
			
			
			if ("type" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->type);
				
			}
			
			
			
			
			if ("warehouseName" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->warehouseName);
				
			}
			
			
			
			
			if ("recAddress" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->recAddress);
				
			}
			
			
			
			
			if ("transferNo" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->transferNo);
				
			}
			
			
			
			
			if ("orderNo" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->orderNo);
				
			}
			
			
			
			
			if ("orderTime" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->orderTime);
				
			}
			
			
			
			
			if ("serialNo" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->serialNo);
				
			}
			
			
			
			
			if ("imei1" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->imei1);
				
			}
			
			
			
			
			if ("imei2" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->imei2);
				
			}
			
			
			
			
			if ("province" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->province);
				
			}
			
			
			
			
			if ("city" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->city);
				
			}
			
			
			
			
			if ("subsidyFlag" == $schemeField){
				
				$needSkip = false;
				$input->readI64($this->subsidyFlag); 
				
			}
			
			
			
			if($needSkip){
				
				\Osp\Protocol\ProtocolUtil::skip($input);
			}
			
			$input->readFieldEnd();
		}
		
		$input->readStructEnd();
		
		
		
	}
	
	public function write($output){
		
		$xfer = 0;
		$xfer += $output->writeStructBegin();
		
		$xfer += $output->writeFieldBegin('transactionId');
		$xfer += $output->writeString($this->transactionId);
		
		$xfer += $output->writeFieldEnd();
		
		$xfer += $output->writeFieldBegin('actionTime');
		$xfer += $output->writeString($this->actionTime);
		
		$xfer += $output->writeFieldEnd();
		
		$xfer += $output->writeFieldBegin('sn');
		$xfer += $output->writeString($this->sn);
		
		$xfer += $output->writeFieldEnd();
		
		$xfer += $output->writeFieldBegin('type');
		$xfer += $output->writeString($this->type);
		
		$xfer += $output->writeFieldEnd();
		
		$xfer += $output->writeFieldBegin('warehouseName');
		$xfer += $output->writeString($this->warehouseName);
		
		$xfer += $output->writeFieldEnd();
		
		$xfer += $output->writeFieldBegin('recAddress');
		$xfer += $output->writeString($this->recAddress);
		
		$xfer += $output->writeFieldEnd();
		
		$xfer += $output->writeFieldBegin('transferNo');
		$xfer += $output->writeString($this->transferNo);
		
		$xfer += $output->writeFieldEnd();
		
		$xfer += $output->writeFieldBegin('orderNo');
		$xfer += $output->writeString($this->orderNo);
		
		$xfer += $output->writeFieldEnd();
		
		if($this->orderTime !== null) {
			
			$xfer += $output->writeFieldBegin('orderTime');
			$xfer += $output->writeString($this->orderTime);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->serialNo !== null) {
			
			$xfer += $output->writeFieldBegin('serialNo');
			$xfer += $output->writeString($this->serialNo);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->imei1 !== null) {
			
			$xfer += $output->writeFieldBegin('imei1');
			$xfer += $output->writeString($this->imei1);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->imei2 !== null) {
			
			$xfer += $output->writeFieldBegin('imei2');
			$xfer += $output->writeString($this->imei2);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->province !== null) {
			
			$xfer += $output->writeFieldBegin('province');
			$xfer += $output->writeString($this->province);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->city !== null) {
			
			$xfer += $output->writeFieldBegin('city');
			$xfer += $output->writeString($this->city);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->subsidyFlag !== null) {
			
			$xfer += $output->writeFieldBegin('subsidyFlag');
			$xfer += $output->writeI64($this->subsidyFlag);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		$xfer += $output->writeFieldStop();
		$xfer += $output->writeStructEnd();
		return $xfer;
	}
	
}

?>